﻿@using System.Diagnostics
@{
    ViewData["Title"] = "订单管理";
}

<div class="panel panel-default">
    <div class="form-content">
        <div class="form-body">
            <div class="row" id="filter" data-toggle="form" data-field="Order" data-grid="#grid" data-filterable="true">
                <input data-field="customer" data-size="4,0,12" data-logic="or" data-operator="contains" />
                <button data-button="query">查询</button>
                <button data-button="clear">清除条件</button>
                <div class="pull-right" style="padding-right:15px;">
                    <button data-button="add" data-popup="Edit">新 增</button>
                </div>
            </div>
            <div id="grid" data-toggle="grid" data-form="#filter" node="grid" data-related="#_PopupDetail">
                <div node="columns" node-type="array">
                    <span data-field="customer" data-title="客户"></span>
                    <span data-field="amount" data-title="订单金额"></span>
                    <span data-field="orderTime" data-title="下单时间" data-type="date"></span>
                </div>
                <span node="dataSource">
                    <span node="transport">
                        <span node="read" data-url="/odata/Orders">
                        </span>
                    </span>
                </span>
            </div>
        </div>
    </div>
</div>

<div id="_PopupDetail" data-toggle="popup" data-type="Detail" data-title="订单信息" data-size="small">
    <div class="popup-content" data-toggle="form" data-field="Detail" data-detailable="true" data-size="12,4,8">
        <div class="popup-body">
            <div class="form-content">
                <div class="form-body">
                    <span data-field="customer" data-label="客户"></span>
                    <span data-field="amount" data-label="订单金额"></span>
                    <span data-field="orderTime" data-label="下单时间" data-formatter="#:el=>$.com.dateTimeFormatter(el.options.value)"></span>
                </div>
            </div>
        </div>
        <div class="popup-footer text-right">
            <button data-button="edit" data-popup="Edit">编 辑</button>
            <button data-button="close">关 闭</button>
        </div>
    </div>
</div>

<div id="_PopupEdit" data-toggle="popup" data-type="Edit" data-title="订单信息" data-related="#filter" data-size="small">
    <div class="popup-content" data-toggle="form" data-field="Edit" data-editable="true" data-url="/api/Orders" data-size="12,3,7">
        <div class="popup-body">
            <div class="form-content">
                <div class="form-body">
                    <input data-field="customer" data-label="客户" required />
                    <input data-field="amount" data-label="订单金额" />
                </div>
            </div>
        </div>
        <div class="popup-footer text-right">
            <button data-button="post" data-success-text="新增成功">新 增</button>
            <button data-button="put" data-success-text="保存成功">提 交</button>
            <button data-button="delete" data-success-text="删除成功">删 除</button>
            <button data-button="close">关 闭</button>
        </div>
    </div>
</div>